package demo14;
/*
题目：发红包(练习继承的一些应用)
发红包的逻辑 三要素:
返回值类型：ArrayList<Integer>
方法名称：send
参数列表：1.总共发多少钱  int totalMoney
         2.分成多少分    int count
public ArrayList<Integer>send(int totalMoney,int count){
    //.
}

收到红包的逻辑，三要素：
返回值类型：void
方法名称：receive
参数列表：ArrayList<Integer>
public void receive(ArrayList<Integer>list){
    //...
}*/

import java.util.ArrayList;

public class MainRedPacket {
    public static void main(String[] args) {
        Manager manager = new Manager("群主", 100);
        Member one = new Member("成员A", 0);
        Member two = new Member("成员B", 0);
        Member three = new Member("成员C", 0);

        manager.show();//100
        one.show();//0
        two.show();//0
        three.show();//0
        System.out.println("=========");

        //群主共发20块钱，分成3个红包
        ArrayList<Integer> redList=manager.send(20,3);
        //三个普通成员收红包
        one.receive(redList);
        two.receive(redList);
        three.receive(redList);

        manager.show();//100-20=80
        //6.6.8随机分给三个人
        one.show();
        two.show();
        three.show();

    }
}
